$(function(){
	
	
	// 填充 鸿鑫旗下的公司
	var par = {
		id : geetOpation()['id']
	};
	geetdata("../../articledetail/list.do", par, "#content", "content_detail", '', false, function(){
		 iBShare.init();    //初始化 
	});
	
	// 查询 综合新闻 102
	var par = {
			cid:102,
			status:1,
			pageNo:1,
			pageSize:3
	};
	geetdata("../../article/pagelist.do", par, "#zhxwND", "zhxwND_list", "zonghexinwennd", false);
	
	// 查询 深度报道 103
	var par = {
			cid:103,
			status:1,
			pageNo:1,
			pageSize:3
	};
	// geetdata("../../article/list.do", par, "#bText", "sdbdND_list", "shengdubaodaond", false);
	$.getJSON("../../article/list.do", par,function(json){
		view(json, "#bText", "sdbdND_list");
		(function(){
			var oBScroll=document.getElementById('scroll');
		    var oPre=document.getElementById('clickP');
		    var oNext=document.getElementById('clickN');

		    var oBBox=document.getElementById('bMax');
		    var oBText=document.getElementById('bText');
		    var maxContTop=oBText.offsetHeight-oBBox.offsetHeight;
		    var maxSTop=oBScroll.parentNode.offsetHeight-oBScroll.offsetHeight;
		    var top=0;

		    oBScroll.onmousedown=function(ev){
		        var oEvent=ev || event;
		        var disY=oEvent.clientY-oBScroll.offsetTop;

		        document.onmousemove=function(ev){
		            var oEvent=ev || event;
		            top=oEvent.clientY-disY;

		            if(top<0){
		                top=0;
		            }else if(top>maxSTop){
		                top=maxSTop;
		            }
		            oBScroll.style.top=top+'px';
		            var nContTop=top/maxSTop*maxContTop;
		            oBText.style.top=-(nContTop)+'px';
		        };

		        document.onmouseup=function(){
		            document.onmousemove=null;
		            document.onmouseup=null;

		            oBScroll.releaseCapture && oBScroll.releaseCapture();
		        };
		        oBScroll.setCapture && oBScroll.setCapture();
		        return false;
		    };

		    oNext.onmousedown=function(){
		        top+=40;

		        if(top>maxSTop){
		            top=maxSTop;
		        }
		        oBScroll.style.top=top+'px';
		        var nContTop=top/maxSTop*maxContTop;
		        oBText.style.top=-(nContTop)+'px'
		    };

		    oPre.onmousedown=function(){
		        top-=40;

		        if(top<0){
		            top=0;
		        }
		        oBScroll.style.top=top+'px';
		        var nContTop=top/maxSTop*maxContTop;
		        oBText.style.top=-nContTop+'px'
		    };

		    function getStyle(obj, sName){
		        return (obj.currentStyle || getComputedStyle(obj, false))[sName];
		    }
		})();
	});
	
});
